<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
<!--
 * Created on 2010-6-17
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
-->
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <link href="<?php echo $this->baseUrl(); ?>/public/css/style1.css" rel="stylesheet" type="text/css" />
  <title>日志管理</title>
 </head>
 <body>
<?php switch($this->x) : ?>
<?php case 'add' : ?>
<h5>添加日志</h5>
<form action="" method="post" id="add">
<table border="1" bordercolor="#4ab902" cellpadding=3 cellspacing=1 class=css_table bgcolor='#E1E1E1'>
<tr>
	<th>标题</th>
	<td><input name="title" type="text" /></td>
</tr>
<tr>
	<th>分类</th>
	<td>
	<select name="classid" id="classid">
		<?php foreach($this->arrclass as $key) {?>
		<option value="<?php echo $key['id']; ?>"><?php echo $key['classname']; ?></option>
		<?php } ?>
	</select>
	</td>
</tr>
<tr>
	<th>内容</th>
	<td><?=$this->editor; ?></td>
</tr>
<tr>
	<th>Tags</th>
	<td><input name="tags"  type="text"/>*多个请用逗号隔开</td>
</tr>
<tr>
	<th>是否允许评论</th>
	<td><input name="iscomment" type="checkbox" checked="checked"/></td>
</tr>
<tr>
	<th>是否隐藏</th>
	<td><input name="ishidden" type="checkbox" /></td>
</tr>
<tr>
	<th>是否置顶</th>
	<td><input name="iszd" type="checkbox" /></td>
</tr>
<tr>
<td  align="right"><input type="submit" name="add" value="添加"></td><td align="left"><input type="button"  value="取消" onclick="javascript:history.go(-1);"></td>
</tr>
</table>
</form>
<?php break; ?>
<?php case 'edit' : ?>
<h5>编辑日志</h5>
<form action="" method="post" id="edit">
<table border="1" bordercolor="#4ab902" cellpadding=3 cellspacing=1 class=css_table bgcolor='#E1E1E1'>
<tr>
	<th>ID</th>
	<td><?php echo $this->id; ?><input type="hidden" name="id" value="<?php echo $this->id; ?>"></td>
</tr>
<tr>
	<th>标题</th>
	<td><input name="title" type="text" value="<?php echo $this->title; ?>" /></td>
</tr>
<tr>
	<th>分类</th>
	<td>
	<select name="classid" id="classid">
		<?php foreach($this->arrclass as $key) {?>
		<?php if($key['id']==$this->classid){ ?>
		<option value="<?php echo $key['id']; ?>" selected ><?php echo $key['classname']; ?></option>
		<?php } else { ?>
		<option value="<?php echo $key['id']; ?>"  ><?php echo $key['classname']; ?></option>
		<?php } ?>
		<?php } ?>
	</select>
	</td>
</tr>
<tr>
	<th>内容</th>
	<td><?=$this->editor; ?></td>
</tr>
<tr>
	<th>Tags</th>
	<td><input name="tags"  type="text" value="<?php echo $this->tags ?>"/>*多个请用逗号隔开</td>
</tr>
<tr>
	<th>是否允许评论</th>
	<td><input name="iscomment" type="checkbox" <?php if($this->iscomment=='1'){ ?>checked="checked"<?php } ?> /></td>
</tr>
<tr>
	<th>是否隐藏</th>
	<td><input name="ishidden" type="checkbox" <?php if($this->ishidden=='1'){ ?>checked="checked"<?php } ?> /></td>
</tr>
<tr>
	<th>是否置顶</th>
	<td><input name="iszd" type="checkbox" <?php if($this->iszd=='1'){ ?>checked="checked"<?php } ?> /></td>
</tr>
<td  align="right"><input type="submit" name="edit" value="编辑"></td><td align="left"><input type="button"  value="取消" onclick="javascript:history.go(-1);"></td>
</tr>
</table>
</form>
<?php break; ?>
<?php default : ?>
 <h5 >日志列表</h5><a href="<?php echo $this->baseUrl; ?>/admin/blog/add/">添加</a>
 <table  border="1" bordercolor="#4ab902" cellpadding=3 cellspacing=1 class=css_table bgcolor='#E1E1E1' >
 <thead>
 	<tr>	
	<th width=10%>操作</th>
	<th>ID</th>
 	<th>标题</th>
 	<th>分类</th>
 	<th>时间</th>
 	<th>评论数</th>
 	</tr>
 </thead>
 <tbody>
    <?php foreach($this->paginator as $key): ?>
 	<tr align="center">
	<td><a href="<?php echo $this->baseUrl; ?>/admin/blog/edit/id/<?php echo $this->escape($key['id']) ?>">Edit</a>|<a href="<?php echo $this->baseUrl; ?>/admin/blog/del/id/<?php echo $this->escape($key['id']) ?>" onclick="javascript:if(!confirm('您确定要删除吗？')){return false;}">Delete</a></td>
 	<td><?php echo $this->escape($key['id']) ?></td>
 	<td><?php echo $this->escape($key['title']) ?></td>
 	<td><?php echo $this->escape($key['classname']) ?></td>
 	<td><?php echo $this->escape($key['posttime']) ?></td>
 	<td><?php echo $this->escape($key['commnums']) ?></td>
 	</tr>
 	<?php endforeach; ?>
 </tbody>
 </table>
 <?php echo $this->paginationControl($this->paginator, 'Sliding', 'page.phtml'); ?>
<?php endswitch; ?>
 </body>
</html>
